package com.xu.crawler.dao.impl;

import com.xu.crawler.dao.StockHolderDao;
import com.xu.crawler.dao.entity.StockHolderDO;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by clear on 2018/8/19.
 */
@Repository
public class StockHolderDaoImpl implements StockHolderDao {

    @Resource
    private MongoTemplate mongoTemplate;

    @Override
    public void save(StockHolderDO stockHolderDO) {
        mongoTemplate.save(stockHolderDO);
    }

    @Override
    public void batchSave(List<StockHolderDO> stockHolderDOList) {
        mongoTemplate.insertAll(stockHolderDOList);
    }
}
